<template>
  <div>
    <p ref="p">{{ msg }}</p>
  </div>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {},
  data() {
    return {
      msg: '数据',
    }
  },
  computed: {
    time() {
      setInterval(() => {
        console.log('定时器')
      }, 1)
    },
  },
  beforeCreate() {
    console.log(' beforeCreate', this.msg)
  },
  created() {
    this.time
    console.log('created', this.msg)
  },
  beforeMount() {
    console.log('beforeMount', this.$refs.p)
  },
  mounted() {
    console.log('beforeMount', this.$refs.p)
  },
  beforeUpdate() {
    console.log('beforeUpdate', this.$refs.p, this.msg)
  },
  updated() {
    console.log('beforeUpdate', this.$refs.p, this.msg)
  },
  beforeDestroy() {
    console.log('beforeDestroy')
  },
  destroyed() {
    console.log('beforeDestroy')
  },
}
</script>

<style scoped></style>
